{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Blending Problem\n",
"## Problem definition"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The Kahuna company manufactures sausages using three kinds of meat. The relevant information about the ingredients is provided in the table below:\n",
"\n",
"| Ingredient | Cost (€/kg) | Availability (kg) |\n",
"|------------|--------------|-------------------|\n",
"| Pork | 4.32 | 30 |\n",
"| Wheat | 2.46 | 20 |\n",
"| Starch | 1.86 | 17 |\n",
"\n",
"The company makes two types of sausages:\n",
"* Economy (>=40% Pork)\n",
"* Premium (>=60% Pork)\n",
"\n",
"One sausage is 50 grams (0.05 kg)\n",
"\n",
"According to government regulations, the most starch we can use in our sausages is 25%\n",
"\n",
"We have a contract with a butcher, and have already purchased 23 kg pork, that will go bad if it's not used.\n",
"\n",
"We have a demand for 350 economy sausages and 500 premium sausages.\n",
"\n",
"**Write a linear program to figure out how to most cost effectively blend our sausages.**"
]
},
{
"cell_type": "markdown",
"metadata": {
"pycharm": {
"name": "#%% md\n"
}
},
"source": [
"Let's model our problem\n",
"\n",
" *pe* = Pork in the economy sausages (kg) \n",
" *we* = Wheat in the economy sausages (kg) \n",
" *se* = Starch in the economy sausages (kg) \n",
" *pp* = Pork in the premium sausages (kg) \n",
" *wp* = Wheat in the premium sausages (kg) \n",
" *sp* = Starch in the premium sausages (kg) \n",
"\n",
"We want to minimise costs such that:\n",
"\n",
"Cost = 4.32(*pe* + *pp*) + 2.46(*we* + *wp*) + 1.86(*se* + *sp*)\n",
"\n",
"\n",
"With the following constraints:\n",
"\n",
" *pe* + *we* + *se* = 350 \\* 0.05 \n",
" *pp* + *wp* + *sp* = 500 \\* 0.05 \n",
" *pe* ≥ 0.4(*pe* + *we* + *se*) \n",
" *pp* ≥ 0.6(*pp* + *wp* + *sp*) \n",
" *se* ≤ 0.25(*pe* + *we* + *se*) \n",
" *sp* ≤ 0.25(*pp* + *wp* + *sp*) \n",
" *pe* + *pp* ≤ 30 \n",
" *we* + *wp* ≤ 20 \n",
" *se* + *sp* ≤ 17 \n",
" *pe* + *pp* ≥ 23\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
},
"pycharm": {
"stem_cell": {
"cell_type": "raw",
"source": [],
"metadata": {
"collapsed": false
}
}
}
},
"nbformat": 4,
"nbformat_minor": 1
}